****Number of Statutes

clear all
set more off

import delimited using "$folder/data/input/statutes_by_state_year.csv", clear
drop v1
keep if year>1964

gen biennium =  year + mod(year,2)
replace year = biennium

rename state state_abbrev

egen state = group(state_abbrev)

collapse (count) statutes = statute_id (mean) word_statute_m = word_count , by(state year)

save statutes_state_bien, replace

****Amend/Repeal 

clear all
set more off

import delimited using "$folder/data/input/repeal_amend_by_biennium.csv", clear

rename state state_abbrev
rename biennium year
drop v1 index

save data_amend_repeal, replace

****Error Rate

clear all
set more off

import delimited using "$folder/data/input/correct_rate_by_state_year.csv", clear

rename state state_abbrev
rename biennium year

drop v1

gen error_rate = 1 - correct_rate

save data_amend_repeal_error, replace
